package Tool;

public class tool{
    public void traverse(String s){
        char arr[] = s.toCharArray();
        int i = 0;
        for(i = 0; i < s.length(); i++){
            System.out.print(arr[i]+" ");
        }
        System.out.println("\n");
    }
    public void reverse(String s){
        int left = 0;
        int right = s.length()-1;
        char arr[] = s.toCharArray();
        while(left < right){
            char temp = arr[left];
            arr[left] = arr[right];
            arr[right] = temp;
            left++;
            right--;
        }
        int i = 0;
        for(i = 0; i < s.length(); i++){
            System.out.print(arr[i]);
        }
        System.out.println("\n");
    }

}
